package application.util;

import javafx.geometry.Bounds;
import javafx.scene.Node;

public class PositionUtil {

    public static double getScreenMinX(Node node) {
        Bounds bounds = node.localToScreen(node.getLayoutBounds());
        return bounds.getMinX();
    }

    public static double getScreenMaxX(Node node) {
        Bounds bounds = node.localToScreen(node.getLayoutBounds());
        return bounds.getMaxX();
    }

    public static double getScreenMinY(Node node) {
        Bounds bounds = node.localToScreen(node.getLayoutBounds());
        return bounds.getMinY();
    }

    public static double getScreenMaxY(Node node) {
        Bounds bounds = node.localToScreen(node.getLayoutBounds());
        return bounds.getMaxY();
    }

    public static double getLayoutMinX(Node node) {
        Bounds bounds = node.localToScene(node.getLayoutBounds());
        return bounds.getMinX();
    }

    public static double getLayoutMaxX(Node node){
        Bounds bounds = node.localToScene(node.getLayoutBounds());
        return bounds.getMaxX();
    }

    public static double getLayoutMinY(Node node){
        Bounds bounds = node.localToScene(node.getLayoutBounds());
        return bounds.getMinY();
    }

    public static double getLayoutMaxY(Node node){
        Bounds bounds = node.localToScene(node.getLayoutBounds());
        return bounds.getMaxY();
    }
}
